package it.koutifaris.travianmap.dal.sqlservices.travianserver;

import static it.koutifaris.testforclassutils.IsTestForAssert.assertIsTestFor;
import it.koutifaris.travianmap.dal.TravianServerSettingsService.TravianServerSettings;
import junit.framework.Assert;
import android.test.AndroidTestCase;

public class TravianServerSettingsBuilderTest extends AndroidTestCase {

	private static final String TEST_SERVER = "tsx.travian.it";

	public void testPkgAndName() {
		assertIsTestFor(TravianServerSettingsBuilder.class);
	}

	public void testEquals() {
		TravianServerSettings settings = TravianServerSettingsBuilder.settingsBuilder()
				.setServer(TEST_SERVER)
				.setAutoUpdate(true)
				.setWifiOnly(false)
				.build();

		TravianServerSettings settings2 = TravianServerSettingsBuilder.settingsBuilder()
				.setServer(TEST_SERVER)
				.setAutoUpdate(true)
				.setWifiOnly(false)
				.build();

		Assert.assertTrue(settings.equals(settings2));
	}

	public void testDifferent() {
		TravianServerSettings settings = TravianServerSettingsBuilder.settingsBuilder()
				.setServer(TEST_SERVER)
				.setAutoUpdate(false)
				.setWifiOnly(false)
				.build();

		TravianServerSettings settings2 = TravianServerSettingsBuilder.settingsBuilder()
				.setServer(TEST_SERVER)
				.setAutoUpdate(true)
				.setWifiOnly(false)
				.build();

		Assert.assertFalse(settings.equals(settings2));
	}

}
